import {lazy} from "react"
import {Navigate} from "react-router-dom"
const Home = lazy(()=>import("../pages/home"))
const Detail =lazy(()=>import("../pages/detail"))
const Shopcar = lazy(()=>import("../pages/shopcar"))
const All = lazy(()=>import("../pages/all"))
const Shophome = lazy(()=>import("../pages/shophome"))
const Address = lazy(()=>import("../pages/address"))
const Form1 = lazy(()=>import("../pages/form"))
let routerconfig = [
    {
        path:"/home",
        element:<Home></Home>
    },
    {
        path:"/detail",
        element:<Detail></Detail>
    },
    {
        path:"/all",
        element:<All></All>,
        children:[
            {
                path:"/all/home",
                element:<Shophome></Shophome>

            },
            {
                path:"/all/shopcar",
                element:<Shopcar></Shopcar>
            },
            {
                path:"/all/address",
                element:<Address></Address>
            }
        ]
    },
    {
        path:"/shopcar",
        element:<Shopcar></Shopcar>
    },
    {
        path:"/form",
        element:<Form1></Form1>
    },
    {
        path:"/",
        element:<Navigate to="/all/home"></Navigate>
    },
   
]
export default routerconfig